<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">
    <f:view>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
            <title>Contratos</title>
            <!--<link type="text/css" href="../common/css/redmond/jquery-ui-1.8.23.custom.css" rel="stylesheet" />-->
            <link type="text/css" href="../common/css/custom-theme-cupertino/jquery-ui-1.8.16.custom.css" rel="stylesheet" />
            <link type="text/css" href="../common/css/administrar.css" rel="stylesheet" />
            <script type="text/javascript" src="../common/js/jquery-1.4.2.min.js"></script>
            <script type="text/javascript" src="../common/js/jquery.ui.all.js"></script>
            <script type="text/javascript" src="../common/js/jquery.layout.js"></script>
            <script type="text/javascript" src="../common/js/jquery-ui-1.8.16.custom.min.js"></script>
            <script type="text/javascript" src="../common/js/calendarioui-es.js"></script>
            <script type="text/javascript" src="../common/js/jquery.dateentry.js"></script>
            <script type="text/javascript" src="../common/js/admision.js"></script>
            <script type="text/javascript" src="../common/js/jquery.tablesorter.min.js"></script>
            <script type="text/javascript" src="../common/js/jquery.metadata.js"></script>
            <script type="text/javascript" src="../common/js/jquery.tablesorter.pager.js"></script>
            <script type="text/javascript" src="../common/js/jquery.validate.js"></script>
            <script type="text/javascript" src="../common/js/jquery.pagination.js"></script>
            <script type="text/javascript" src="../common/js/jquery.contextMenu.js"></script>
            <link type="text/css" href="../common/css/jquery.contextMenu.css" rel="stylesheet" />
            <link type="text/css" href="../common/css/pagination.css" rel="stylesheet" />
            <script type="text/javascript" src="../common/js/jquery.qtip-1.0.0-rc3.js"></script>
            <script type="text/javascript" src="../common/js/ui.panel.js"></script>
            <style type="text/css" title="currentStyle">
                @import "../common/css/demo_page.css";			
                @import "../common/css/demo_table_jui.css";
            </style>
            <script type="text/javascript" language="javascript" src="../common/js/jquery.dataTables.js"></script>

        </head>


        <body>           

            <div id="pantalla-admision" style="display: block">


                <div style="width: 100%; text-align: center;">

                    <table width="100%">
                        <tr>
                            <td  class="ui-state-hover" align="left">    
                                Admisi&oacute;n de usuarios / pacientes &nbsp;&nbsp;<b style="color:green;width: 230px" id="txt-servicio"></b>
                            </td>
                            <td class="ui-state-hover" align="right">
                                <button id="configBtn">Config</button>               
                            </td>
                            <td class="ui-state-hover" align="right">                            
                                <button id="ayudaBtn">Ayuda</button>               
                            </td>
                        </tr>
                    </table>         

                    <div class="tooltips">

                    </div> 


                    <form id="form-admision">

                        <div id="panel-general">


                            <!--<h3 style="text-align: center" class="ui-widget-header">Admisi&oacute;n</h3>-->


                            <table width="100%">
                                <tr>
                                    <td align="left">
                                        <button id="nuevaAdmisionBtn">Nueva</button>       
                                    </td>
                                </tr>
                            </table>      




                            <div id="panel1">   
                                <h4>Datos Generales</h4>
                                <table>
                                    <tr>
                                        <td>Identificaci&oacute;n</td>
                                        <td>
                                            <input type="text" size="10" ondblclick="buscarPacienteCodigo()" maxlength="20" id="identificacion" value=""/>
                                            <input type="hidden" id="idpaciente" name="idpaciente" value="" />
                                        </td>
                                        <td>                                        
                                            <img src="../common/img/user_search.png"  onclick="buscarPacienteCodigo()" style="cursor: pointer" alt="buscarPaciente" />
                                            <img src="../common/img/edit-clear.png" onclick="clearPacientecodigo()" style="cursor: pointer" alt="Eliminar" />
                                        </td>
                                        <td>
                                            <input type="text" size="40" readonly="true" id="nombres" value="" />

                                        </td>
                                        <td> 
                                            Estado Ingreso
                                        </td>
                                        <td>              
                                            <select style="width: 160px" id="id_estadoing" name="id_estadoing" class="text ui-widget-content"></select>
                                        </td>
                                    </tr>                    

                                    <tr>
                                        <td>Administradora</td>
                                        <td>
                                            <select style="width: 160px" id="id_entidad" name="id_entidad" class="text ui-widget-content"></select>                          
                                        </td>
                                        <td>
                                            Contrato    
                                        </td>
                                        <td>
                                            <select style="width: 200px" id="idcps" name="idcps" class="text ui-widget-content"></select>
                                        </td>
                                        <td>
                                            Prioridad
                                        </td>
                                        <td>
                                            <select style="width: 160px" id="id_prioridad" name="id_prioridad" class="text ui-widget-content"></select>   
                                        </td>
                                    </tr>

                                    <tr>
                                        <td>Via de Ingreso</td>
                                        <td>
                                            <select style="width: 160px" id="id_via" name="id_via" class="text ui-widget-content"></select>                          
                                        </td>
                                        <td>
                                            Causa Externa
                                        </td>

                                        <td>
                                            <select style="width: 200px" id="id_causaex" name="id_causaex" class="text ui-widget-content"></select>
                                        </td>
                                        <td>
                                            Diagn&oacute;stico
                                        </td>
                                        <td>
                                            <input type="text" size="40" readonly="true"  maxlength="40" id="codDx" value="" ondblclick="buscarDiag(1)"/>
                                            <input type="hidden" id="idDx" name="idDx" value="" />
                                        </td>
                                    </tr>

                                    <tr>
                                        <td>
                                            M&eacute;dico
                                        </td>

                                        <td>
                                            <select style="width: 160px" id="id_medico" name="id_medico" class="text ui-widget-content"></select>
                                        </td>
                                        <td>Unidad Funcional</td>
                                        <td>
                                            <select style="width: 200px" id="id_undfunc" name="id_undfunc" class="text ui-widget-content"></select>                          
                                        </td>
                                        <td>
                                            IPS Remite
                                        </td>
                                        <td>
                                            <input type="text" size="40" readonly="true"  maxlength="40" id="ipsr" value="" ondblclick="buscarIpsr()"/>
                                            <input type="hidden" id="idIpsr" name="idIpsr" value="" />
                                        </td>                        
                                    </tr>
                                    <tr>
                                        <td>Observaci&oacute;n</td>
                                        <td colspan="3">
                                            <textarea cols="75" rows="2" id="observacion" name="observacion"></textarea>
                                        </td>
                                        <td>
                                            Autorizaci&oacute;n    
                                        </td>                        
                                        <td>
                                            <input type="text" size="15" id="autorizacion" value="" />
                                        </td>                        
                                    </tr>

                                    <tr>
                                        <td colspan="6" align="center">
                                            <table>
                                                <tr>
                                                    <td>
                                                        <button id="btnAmbulatoria">Ambulatoria</button>
                                                    </td>
                                                    <td>
                                                        <button id="btnUrgencia">Urgencia</button>
                                                    </td>
                                                    <td>
                                                        <button id="btnHospitalizacion">Hospitalizaci&oacute;n</button>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="3" align="center">
                                                        <button id="btnAcompanante" class="ui-state-error">Acompa&ntilde;ante</button>                                    
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </div>


                            <div id="panel-admision" style="display: none">

                                <div id="panel-ambulatoria">
                                    <h4>Ambulatoria</h4>                
                                    <table> 
                                        <td>Fecha Ingreso</td>
                                        <td>
                                            <input type="text" size="12" id="fecha_ingresoamb"  name="fecha_ingresoamb" value="" />
                                        </td>
                                        <tr>                        
                                            <td>
                                                Motivo Consulta
                                            </td>
                                            <td>
                                                <textarea id="motivo_amb" name="notivo_amb" cols="70" rows="5"></textarea>
                                            </td>
                                        </tr>
                                    </table>               

                                </div>

                                <div id="panel-urgencia">
                                    <h4>Urgencias</h4>
                                    <table>
                                        <tr>
                                            <td>Tipo Urgencia</td>
                                            <td>
                                                <select style="width: 200px" id="id_tipourg" name="id_tipourg" class="text ui-widget-content"></select>
                                            </td>
                                            <td>Fecha Ingreso</td>
                                            <td>
                                                <input type="text" size="12" id="fecha_ingresourg"  name="fecha_ingresourg" value="" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="4" class="ui-widget-header"></td>
                                        </tr>
                                        <tr>                        
                                        </tr>
                                        <tr>
                                            <td>Diagn&oacute;stico</td>
                                            <td colspan="3">
                                                <input type="text" size="59" readonly="true"  maxlength="40" id="dxurg" name="dxurg" value="" ondblclick="buscarDiag(2)"/>
                                                <input type="hidden" id="iddxurg" name="iddxurg" value="" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>Diagn&oacute;stico Egreso1</td>
                                            <td colspan="3">
                                                <input type="text" size="59" readonly="true"  maxlength="40" id="dxurg1" name="dxurg1" value="" ondblclick="buscarDiag(3)"/>
                                                <input type="hidden" id="iddxurg1" name="iddxurg1" value="" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>Diagn&oacute;stico Egreso2</td>
                                            <td colspan="3">
                                                <input type="text" size="59" readonly="true"  maxlength="40" id="dxurg2" name="dxurg2" value="" ondblclick="buscarDiag(4)"/>
                                                <input type="hidden" id="iddxurg2" name="iddxurg2" value="" />
                                            </td>
                                        </tr>                    
                                        <tr>
                                            <td>Diagn&oacute;stico Egreso3</td>
                                            <td colspan="3">
                                                <input type="text" size="59" readonly="true"  maxlength="40" id="dxurg3" name="dxurg3" value="" ondblclick="buscarDiag(5)"/>
                                                <input type="hidden" id="iddxurg3" name="iddxurg3" value="" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>Diagn&oacute;stico Complicaci&oacute;n</td>
                                            <td colspan="3">
                                                <input type="text" size="59" readonly="true"  maxlength="40" id="dxcomurg" name="dxcomurg" value="" ondblclick="buscarDiag(6)"/>
                                                <input type="hidden" id="iddxcomurg" name="iddxcomurg" value="" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>Diagn&oacute;stico Muerte</td>
                                            <td colspan="3">
                                                <input type="text" size="59" readonly="true"  maxlength="40" id="dxmuerte" name="dxmuerte" value="" ondblclick="buscarDiag(7)"/>
                                                <input type="hidden" id="iddxmuerte" name="iddxmuerte" value="" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>Fecha Egreso</td>
                                            <td>
                                                <input type="text" size="12" id="fecha_egresourg"  name="fecha_egresourg" value="" />
                                            </td>
                                            <td>Estado Egreso</td>
                                            <td>
                                                <select style="width: 200px" id="id_estadoegresourg" name="id_estadoegresourg" class="text ui-widget-content"></select>
                                            </td>
                                        </tr>
                                        <tr>                        
                                            <td>Destino Egreso</td>
                                            <td>
                                                <select style="width: 200px" id="id_destinoegresourg" name="id_destinoegresourg" class="text ui-widget-content"></select>
                                            </td>                        
                                            <td>Motivo Egreso</td>
                                            <td>
                                                <select style="width: 200px" id="id_motivoegresourg" name="id_motivoegresourg" class="text ui-widget-content"></select>
                                            </td>                        
                                        </tr>
                                    </table>
                                </div>

                                <div id="panel-hospitalizacion">
                                    <h4>Hospitalizaci&oacute;n</h4>
                                    <table>
                                        <tr>                
                                            <td>Fecha Ingreso</td>
                                            <td>
                                                <input type="text" size="12" id="fecha_ingresohos"  name="fecha_ingresohos" value="" />
                                            </td>
                                            <td>Cama</td>
                                            <td>
                                                <input style="width: 200px" id="cama" name="cama" class="" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="4" class="ui-widget-header"></td>
                                        </tr>
                                        <tr>                        
                                        </tr>
                                        <tr>
                                            <td>Diagn&oacute;stico</td>
                                            <td colspan="3">
                                                <input type="text" size="59" readonly="true"  maxlength="40" id="dxhos" name="dxhos" value="" ondblclick="buscarDiag(8)"/>
                                                <input type="hidden" id="iddxhos" name="iddxhos" value="" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>Diagn&oacute;stico Egreso1</td>
                                            <td colspan="3">
                                                <input type="text" size="59" readonly="true"  maxlength="40" id="dxhos1" name="dxhos1" value="" ondblclick="buscarDiag(9)"/>
                                                <input type="hidden" id="iddxhos1" name="iddxhos1" value="" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>Diagn&oacute;stico Egreso2</td>
                                            <td colspan="3">
                                                <input type="text" size="59" readonly="true"  maxlength="40" id="dxhos2" name="dxhos2" value="" ondblclick="buscarDiag(10)"/>
                                                <input type="hidden" id="iddxhos2" name="iddxhos2" value="" />
                                            </td>
                                        </tr>                    
                                        <tr>
                                            <td>Diagn&oacute;stico Egreso3</td>
                                            <td colspan="3">
                                                <input type="text" size="59" readonly="true"  maxlength="40" id="dxhos3" name="dxhos3" value="" ondblclick="buscarDiag(11)"/>
                                                <input type="hidden" id="iddxhos3" name="iddxhos3" value="" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>Diagn&oacute;stico Complicaci&oacute;n</td>
                                            <td colspan="3">
                                                <input type="text" size="59" readonly="true"  maxlength="40" id="dxcomhos" name="dxcomhos" value="" ondblclick="buscarDiag(12)"/>
                                                <input type="hidden" id="iddxcomhos" name="iddxcomhos" value="" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>Diagn&oacute;stico Muerte</td>
                                            <td colspan="3">
                                                <input type="text" size="59" readonly="true"  maxlength="40" id="dxmuertehos" name="dxmuertehos" value="" ondblclick="buscarDiag(13)"/>
                                                <input type="hidden" id="iddxmuertehos" name="iddxmuertehos" value="" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>Fecha Egreso</td>
                                            <td>
                                                <input type="text" size="12" id="fecha_egresohos"  name="fecha_egresohos" value="" />
                                            </td>
                                            <td>Estado Egreso</td>
                                            <td>
                                                <select style="width: 200px" id="id_estadoegresohos" name="id_estadoegresohos" class="text ui-widget-content"></select>
                                            </td>
                                        </tr>

                                        <tr>                        
                                            <td>Destino Egreso</td>
                                            <td>
                                                <select style="width: 200px" id="id_destinoegresohos" name="id_destinoegresohos" class="text ui-widget-content"></select>
                                            </td>                        
                                            <td>Motivo Egreso</td>
                                            <td>
                                                <select style="width: 200px" id="id_motivoegresohos" name="id_motivoegresohos" class="text ui-widget-content"></select>
                                            </td>                        
                                        </tr>

                                    </table>

                                </div>
                            </div>    
                        </div>     

                    </form>

                    <!--Buscar Pacientes-->
                    <div id="dialogoBuscarPac" style="display: none" title="PACIENTES">


                        <div id="busquedaDivPac">
                            <table width="100%">
                                <tr class="ui-widget-header">
                                    <td>
                                        Identificaci&oacute;n
                                    </td>
                                    <td>&nbsp;</td>
                                    <td>&nbsp;</td>
                                    <td>&nbsp;</td>
                                </tr>
                                <tr class="ui-widget-header">                    
                                    <td>
                                        <input onkeyup="validarBusquedaPac(1)" type="text" id="ide" size="16" maxlength="16"/>
                                    </td>
                                    <td>&nbsp;</td>
                                    <td>&nbsp;</td>
                                    <td>&nbsp;</td>
                                </tr>

                                <tr class="ui-widget-header">

                                    <td>Primer Nombre</td>
                                    <td>Segundo Nombre</td>
                                    <td>Primer Apellido</td>
                                    <td>Segundo Apellido</td>
                                </tr>
                                <tr>                    
                                    <td>
                                        <input onkeyup="this.value=this.value.toUpperCase();validarBusquedaPac(2)" type="text" id="n1" size="15" maxlength="20"/>
                                    </td>
                                    <td>
                                        <input onkeyup="this.value=this.value.toUpperCase();validarBusquedaPac(2)" type="text" id="n2" size="15" maxlength="20"/>
                                    </td>
                                    <td>
                                        <input onkeyup="this.value=this.value.toUpperCase();validarBusquedaPac(2)" type="text" id="a1" size="15" maxlength="20"/>
                                    </td>
                                    <td>
                                        <input onkeyup="this.value=this.value.toUpperCase();validarBusquedaPac(2)" type="text" id="a2" size="15" maxlength="20"/>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="5" align="center">
                                        <input class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" id="buscarPac" type="button" value="Buscar"/>
                                    </td>
                                </tr>

                            </table>
                        </div>
                        <div id="datosPac" style="display: none">
                        </div>
                    </div>


                    <div id="dialogo-buscar-diagnosticos" title="Buscar Diagnosticos" style="display: none">
                        <div class="ui-widget">         

                            <input id="tdx" type="text" />

                            <table>
                                <tr>
                                    <td>C&oacute;digo</td>
                                    <td>Descripci&oacute;n</td>
                                </tr>                          
                                <tr>
                                    <td>
                                        <input id="cdxs" size="10" />
                                    </td>
                                    <td>
                                        <input id="dxs" size="30" />
                                    </td>
                                </tr>
                            </table>      
                        </div>
                    </div>

                    <div id="dialogo-buscar-ipsr" title="Buscar prestadores" style="display: none">
                        <div class="ui-widget">                 
                            <table>
                                <tr>
                                    <td>C&oacute;digo</td>
                                    <td>Descripci&oacute;n</td>
                                </tr>                          
                                <tr>
                                    <td>
                                        <input id="cipsr" size="10" />
                                    </td>
                                    <td>
                                        <input id="dipsr" size="30" />
                                    </td>
                                </tr>
                            </table>      
                        </div>
                    </div>


                    <div id="dialogo-buscar-acom" title="AcompaÃ±ante" style="display: none">
                        <div class="ui-widget">                 
                            <table>
                                <tr>
                                    <td>Identificaci&oacute;n</td>
                                    <td>Nombres</td>
                                </tr>                          
                                <tr>
                                    <td>
                                        <input id="ideacom" size="15" />
                                    </td>
                                    <td>
                                        <input id="nomacom" size="30" />
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2" class="ui-widget-header"></td>
                                    <input id="id_acom" type="hidden"  />
                                </tr>
                                <tr>
                                    <td>Tipo Identificaci&oacute;n</td>
                                    <td>
                                        <select style="width: 270px" id="id_tipoideacom" name="id_tipoideacom" class="text ui-widget-content"></select>
                                    </td>
                                </tr>
                                <tr>
                                    <td>Nombres</td>
                                    <td>
                                        <input type="text" size="30" id="nombresacom"  name="nombresacom" value="" />
                                    </td>
                                </tr>
                                <tr>
                                    <td>Apellidos</td>
                                    <td>
                                        <input type="text" size="30" id="apellidosacom"  name="apellidosacom" value="" />
                                    </td>
                                </tr>
                                <tr>
                                    <td>Direcci&oacute;n</td>
                                    <td>
                                        <input type="text" size="30" id="direccionacom"  name="direccionacom" value="" />
                                    </td>
                                </tr>
                                <tr>
                                    <td>Tel&eacute;fono</td>
                                    <td>
                                        <input type="text" size="30" id="telefonoacom"  name="telefonoacom" value="" />
                                    </td>
                                </tr>

                            </table> 
                        </div>
                    </div>



                    <div class="qtip qtip-stylename">
                        <div class="qtip-tip" rel="cornerValue">

                        </div>
                        <div class="qtip-wrapper">
                            <div class="qtip-borderTop"></div>
                            <div class="qtip-contentWrapper">
                                <div class="qtip-title">
                                    <div class="qtip-button"></div>
                                </div>
                                <div class="qtip-content"></div>
                            </div>
                            <div class="qtip-borderBottom"></div>
                        </div>
                    </div>

                </div>

            </div>

        </body>

    </f:view>
</html>

